<template>
	<view>
		<view class="order_img" v-for='val in list' @click="keysz(val.id,val.category_id)">
			<image :src="val.thumbnail" mode="aspectFill"></image>
			<view class="szhji">
				<view class="biao">{{val.post_keywords}}</view>
				<view class="ti">{{val.post_title}}</view>
			</view>
		</view>


		<view class="acea-row row-center-wrapper" style="height: 100rpx; font-size: 25rpx;color: #999;"><span>已经到底啦 ~ </span></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page:1,
				limit:100,
				list:[]
			}
		},
		onLoad(e){
			console.log(e)
			var datas = {
				cid:e.cid,
				page:this.page,
				limit:this.limit
			}
			var that = this
			this.$api('/portal/index/ganhuo',{datas:datas},function(res){
				console.log(res)
				that.list = res.data.data
			})
			var jweixin = require('jweixin-module')
			var that = this
			console.log(jweixin)
				var urls = window.location.href
			this.$api('/portal/index/jsconfig', {datas:{url:urls}}, function(res) {
				console.log(res)
				var s = res.data.data
				jweixin.config({
				    debug: false,
				    appId: s.appId,
				    timestamp: s.timestamp,
				    nonceStr: s.nonceStr,
				    signature:s.signature,
				    jsApiList: ["updateTimelineShareData","updateAppMessageShareData"]
				});
				jweixin.ready(function(){
					jweixin.updateTimelineShareData({
							title: '海绵医学院', // 分享标题
						    link: urls, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
						    imgUrl: 'http://api.haimiantv.cn/upload/default/20200426/86ea4921376b6656f24fbb40e674b361.png', // 分享图标
						    success: function () {
						      // 设置成功
							  console.log(1)

						    }
					})
					jweixin.updateAppMessageShareData({
						title: '海绵医学院', // 分享标题
						desc: '一个专业/有态度的医学直播交流平台', // 分享描述
						link: urls, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
						imgUrl: 'http://api.haimiantv.cn/upload/default/20200426/86ea4921376b6656f24fbb40e674b361.png', // 分享图标
						success: function () {
						  // 设置成功
						}
					  })



				})
				jweixin.error(function(res){
					console.log(res)
				})
			})
		},
		methods: {
			keysz(id,cid){
				uni.navigateTo({
					url:'../kepuxq/kepuxq?id='+id+'&cid='+cid
				})

			}
		}
	}
</script>

<style>
.order_img image{
	width: 698rpx;
	height: 500rpx;
	border-radius: 20rpx;
}
.order_img{
		position: relative;
		margin:  0 auto;
		width: 698rpx;
		height: 500rpx;
		margin-top: 32rpx;
}
.szhji{
	width: 100%;
	height: 100%;
	position: absolute;
	z-index: 1;
	padding: 30rpx;
	box-sizing: border-box;
	left: 0;
	top: 0;
}

.szhji .biao{
	font-size: 26rpx;
	color: #fff;
		text-shadow:1px 2px 3px #000;
}
.szhji .ti{
	font-size: 32rpx;
	color: #fff;
		text-shadow:1px 2px 3px #000;
	margin-top: 20rpx;
}
</style>
